Virtualization technique is a decoupling method for separating underlying hardware devices from upper level operating system and applications, in which a virtual machine monitor (Virtual Machine Monitor, VMM) layer is introduced to directly manage underlying hardware resources, and virtual machine (Virtual Machine, VM) independent of underlying hardware are created and provided for upper level operating system and applications. Virtualization, as one of the underlying important foundational techniques of present popular cloud computing (Cloud Computing) platforms, may significantly improve resource utilization rate of physical devices. As shown in FIG. 1, after system virtualization, multiple VMs can simultaneously run on a single physical machine, the number of virtual machines (VMs) that are supported to run on a physical machine concurrently is called as virtual machine density (Virtual Machine Density), and the larger virtual machine density is, the higher resource utilization rate is.
In order to improve virtual machine density, some schedule mechanism is employed in CPU virtualization to enable a physical CPU to be shared by virtual CPUs of virtual machines, and in theory, arbitrary number of virtual CPUs are possible if performance is not concerned. Peripheral virtualization also can produce arbitrary number of virtual duplications through software simulation or connections to external subsystems, such as SAN (Storage Area Network). However, as to memory virtualization, the premise of providing one physical memory page to multiple virtual machines simultaneously is that those virtual machines have pages with exactly the same content, and therefore, in theory the amount of virtual memory can not exceed physical memory size. In order to exceed the limit of the amount of virtual memory imposed by physical memory size, a memory overcommitment method (in which the amount of virtual memory may exceed physical memory size) is proposed in this art, which comprises: balloon driver (Balloon Driver), content based page sharing (Content Based Page Sharing, CBPS), memory page swap (Memory Page Swap), memory page compression (Memory Page Compression) and populate on demand (PoD), etc.
Balloon driver (Balloon Driver) is installed in a guest operating system (Guest Operating System, GOS), which may induce memory release or allocation in the GOS, and corresponding memory is taken back or allocated to the GOS by the balloon driver, thereby achieving auto scaled memory adjustment.
Content based page sharing (CBPS) method may scan global physical pages and release redundant pages through sharing pages with the same content, thereby reducing the consumption of physical memory.
Memory page swap (Memory Page Swap) or memory page compression (Memory Page Compression) may swap several selected pages of a virtual machine to an external device such as a disk, or losslessly compress them to 1/n page size, so as to release memory for the use of more VMs.
PoD method allocates a specified amount of memory pages for each virtual machine as a memory pool (Memory Pool). The virtual machine virtual memory is set to NULL when starting up instead of mapping to physical pages, and physical pages are allocated from a memory pool only when the virtual memory is actually accessed.
The following defects of techniques in the prior art have been found by the inventors of this application through the development of this application:
Memory consumption during GOS starting up process after virtual machine creation is overlooked in all above schemes, but memory required by virtual machines are entirely allocated to those virtual machines initially and then part of the memory is reclaimed, which may cause that the number of virtual machines that can start up concurrently on a physical machine is restricted by the amount of physical memory, thereby lowering virtual machine density.